<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // let p=new Promise(function(resolve,reject){
        //     reject("haha");
        // });
        // p.then(function(data){
        //     console.log(data);
        // },function(data){
        //     console.log(data+"sss");
        // });
        // p.then(function(data){
        //     console.log(data);
        // }).catch(function(data){
        //     console.log(data+"aaa");
        // });


        function returnPro(){
            let p=new Promise(function(resolve,reject){
                setTimeout(function(){
                    resolve("aaaa");
                },2000);
            });
            return p;
        }

        // let pro=returnPro();
        // pro.then(function(data){
        //     console.log(data);
        // });


        async function show(){
           let result= await returnPro();
           console.log(result);
        }
        show();
        function show2(){
            console.log(222);
        }
        window.onclick=show2;
    </script>
</head>
<body>
    
</body>
</html>